package com.sky.mapper.admin;

import com.sky.pojo.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据分类id查询套餐的数量
     * @param id
     * @return
     */
    @Select("select count(id) from setmeal where category_id = #{categoryId}")
    Integer countByCategoryId(Long id);

    /**
     * 根据菜品id查询套餐的数量
     * @param ids
     * @return
     */
    Integer countByDishIds(@Param("ids") Long[] ids);

    /**
     * 批量保存套餐和菜品的关联关系
     * @param setmealDishes
     */


    void addSetmealDish(@Param("setmealDishes") List<SetmealDish> setmealDishes);

    /**
     * 删除套餐菜品
     * @param ids
     */

    void deleteByIds(@Param("ids") Long[] ids);
}